package com.cpi.cornpp.common.files.dto;

import java.util.Calendar;

import com.cs.common.utils.StringUtils;

public class SAPComponentPurchaseOrderDTO implements SAPComponentDTO {
	private static final long serialVersionUID = 3789670803642456475L;
	private String code;
	private Calendar date;
	private String line;
	private String plant;
	private String supplier;
	private String currency;
	private String material;
	private double quantity;
	private double amount;
	private String ioNumber;
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public Calendar getDate() {
		return date;
	}
	public void setDate(Calendar date) {
		this.date = date;
	}
	public String getLine() {
		return line;
	}
	public void setLine(String line) {
		this.line = line;
	}
	public String getPlant() {
		return plant;
	}
	public void setPlant(String plant) {
		this.plant = plant;
	}
	public String getSupplier() {
		return supplier;
	}
	public void setSupplier(String supplier) {
		this.supplier = supplier;
	}
	public String getCurrency() {
		return currency;
	}
	public void setCurrency(String currency) {
		this.currency = currency;
	}
	public String getMaterial() {
		return material;
	}
	public void setMaterial(String material) {
		this.material = material;
	}
	public double getQuantity() {
		return quantity;
	}
	public void setQuantity(double quantity) {
		this.quantity = quantity;
	}
	public double getAmount() {
		return amount;
	}
	public void setAmount(double amount) {
		this.amount = amount;
	}
	public String getIoNumber() {
		return ioNumber;
	}
	public void setIoNumber(String ioNumber) {
		this.ioNumber = ioNumber;
	}
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object object) {
		boolean equal = false;
		SAPComponentPurchaseOrderDTO sapComponentPurchaseOrder = null;
		if( this == object ){
			equal = true;
		}else{
			if( this instanceof SAPComponentPurchaseOrderDTO ){
				sapComponentPurchaseOrder = (SAPComponentPurchaseOrderDTO)object;
				if( this.hashCode() == sapComponentPurchaseOrder.hashCode() ){
					equal = true;
				}
			}
		}
		return equal;
	}
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode(){
		int hash = 0;
		hash = (this.code!=null?this.code.hashCode():0);
		hash += (this.date!=null?this.date.hashCode():0);
		hash += (this.line!=null?this.line.hashCode():0);
		hash += (this.plant!=null?this.plant.hashCode():0);
		hash += (this.supplier!=null?this.supplier.hashCode():0);
		hash += (this.currency!=null?this.currency.hashCode():0);
		hash += (this.material!=null?this.material.hashCode():0);
		hash += new Double(this.quantity).hashCode();
		hash += new Double(this.amount).hashCode();
		hash += (this.ioNumber!=null?this.ioNumber.hashCode():0);
		return hash;
	}
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		StringBuffer toStringValue = null;
		toStringValue = new StringBuffer(0);
		toStringValue.append(getClass().getName());
		toStringValue.append(STRING_COLON);
		toStringValue.append(this.code);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.date!=null?this.date.getTime().toString():StringUtils.EMPTY_STRING);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.line);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.plant);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.supplier);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.currency);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.material);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.quantity);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.amount);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.ioNumber);
		return toStringValue.toString();
	}
}